import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    userInfo: "",
    token: ""
  },
  mutations: {
    SET_USERINFO: (state, userInfo) => {
      state.userInfo = userInfo;
    },
    SET_TOKEN: (state, token) => {
      state.token = token;
    }
  },
  actions: {},
  modules: {},
  getters: {
    userInfo: state => state.userInfo,
    token: state => state.token
  }
});
